package com.gis.aoitest.source;

import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * @author LnnuUser
 * @create 2021-09-06-下午8:12
 */
public class SourceTest02_File {

    public static void main(String[] args) throws Exception {

        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        // 从文件中读取文件
        DataStreamSource<String> dataStream = env.readTextFile("/home/lnnu/IdeaProjects/FlinkTutorial/src/main/resources/sensor.txt");

        // 打印输出
        dataStream.print();

        // 执行
        env.execute();
    }
}
